package com.windoent.yugioh.ui.activity.meinfo;

import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.baidu.mobstat.StatService;
import com.windoent.yugioh.R;
import com.windoent.yugioh.base.BaseActivity;
import com.windoent.yugioh.utils.XingUtils;
import com.windoent.yugioh.widget.ActivityTitle;


/**
 * author : robert
 * date   : 2021/5/10 17:29
 * desc   :实名认证成功
 */
public class RealNameAuthSucessActivity extends BaseActivity {
    private ActivityTitle mActivityTitle;
    private TextView mTvName;
    private TextView mTvIdNumber;
    private Button mBtnGetCode;

    @Override
    public int getLayout() {
        return R.layout.activity_real_name_auth_sucess;
    }

    @Override
    public void initView() {
        super.initView();

        mActivityTitle = (ActivityTitle) findViewById(R.id.activity_title);
        immersiveStatusBar(mActivityTitle.getView());
        mTvName = (TextView) findViewById(R.id.tv_name);
        mTvIdNumber = (TextView) findViewById(R.id.tv_id_number);
        mBtnGetCode = (Button) findViewById(R.id.btn_get_code);
        mBtnGetCode.setVisibility(View.GONE);
    }


    @Override
    public void initData() {
        super.initData();
        Intent intent = getIntent();
        String realName = intent.getStringExtra("realName");
        String cardNumber = intent.getStringExtra("cardNumber");
        setUi(realName, cardNumber);
    }

    private void setUi(String realName, String cardNumber) {
        mTvName.setText(getString(R.string.string_real_name_colon) + XingUtils.xingName(realName));
        mTvIdNumber.setText(getString(R.string.string_auth_id_number_colon) + XingUtils.xingID(cardNumber));
    }

    @Override
    public void initListener() {
        super.initListener();
        mActivityTitle.setBackListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        mBtnGetCode.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        StatService.onPageStart(this, "实名认证成功界面");
    }

    @Override
    protected void onPause() {
        super.onPause();
        StatService.onPageEnd(this, "实名认证成功界面");
    }
}
